<%@ page import="top.sjydzq.www.bean.User" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>用户中心 - 狗东电商 GD.COM</title>
<link href="../css/before/daohang.css" rel="stylesheet" type="text/css" />
<link href="../css/before/common.css" rel="stylesheet" type="text/css" />
<link href="../css/before/style.css" rel="stylesheet" type="text/css" />
</head>
<%
	User user = (User) session.getAttribute("user");

	int uid;
	if (user != null) {
		uid = user.getId();
	} else {
		uid = 0;
	}
%>
<body>
 <iframe src="/head" frameborder="0" width="100%"> </iframe>
	<div class="blank"></div>
	<div class="block clearfix">
		<div class="location ared">
			我的订单
		</div>
		<div class="blank"></div>
		<div>
			<div class="nFlowBox">
				<table width="99%" align="center" border="0" cellpadding="5"
					cellspacing="1" bgcolor="#dddddd">
					<tr>
						<th>订单编号</th>
						<th>订单金额</th>
						<th>订单日期</th>
						<th>订单状态</th>
						<th>详情</th>
					</tr>
					<tr>
						<td colspan="5" height="15px"
							style="border: 0 none; background: #FFF"></td>
					</tr>
					<c:forEach items="${orders}" var="order">
						<tr>
							<td bgcolor="#ffffff" align="center">${order.id}</td>
							<td bgcolor="#ffffff"  align="center">${order.money}</td>
							<td align="center" bgcolor="#ffffff">${order.formattedDate}</td>
							<td bgcolor="#ffffff"  align="center">
                                <c:if test="${order.status == 0}">
                                    未付款&nbsp;&nbsp;
                                    <a style="text-decoration: none;" class="f6" href="/order/done?oid=${order.id}&uid=<%= uid %>">去支付</a>
                                </c:if>
                                <c:if test="${order.status == 1}">
                                    交易完成
                                </c:if>
							</td>
							<td align="center" bgcolor="#ffffff">
								<a style="text-decoration: none;" class="f6" href="/order/detail?id=${order.id}&uid=<%= uid %>" target="_blank">详情</a>
							</td>
						</tr>
					</c:forEach>
				</table>
			</div>
		</div>
		<div class="location ared">
			我的关注
		</div>
		<div class="blank"></div>
		<div>
			<div class="nFlowBox">
				<table width="99%" align="center" border="0" cellpadding="5"
					cellspacing="1" bgcolor="#dddddd">
					<tr>
						<th>商品编号</th>
						<th>商品名称</th>
						<th>商品图片</th>
						<th>商品价格</th>
						<th>去看看</th>
					</tr>
					<tr>
						<td colspan="5" height="15px"
							style="border: 0 none; background: #FFF"></td>
					</tr>
					<c:forEach items="${products}" var="product">
						<tr>
							<td bgcolor="#ffffff" align="center">${product.id}</td>
							<td bgcolor="#ffffff"  align="center">${product.gname}</td>
							<td align="center" bgcolor="#ffffff" height="60px"> <img
									style="width: 50px; height: 50px;"
									src="${product.gpicture}" border="0"
									title="${product.gname}" /> </td>
							<td align="center" bgcolor="#ffffff">10</td>
							<td align="center" bgcolor="#ffffff">
								<a style="text-decoration: none;" class="f6" href="/product/detail?id=${product.id}">去看看</a>
							</td>
						</tr>
					</c:forEach>
				</table>
			</div>
		</div>
	</div>
</body>
</html>
